Skip to content
This repository has been archived by the owner on Apr 23, 2024. It is now read-only.
/ js-client Public archive

fix(#325): toActionable method is falling on error Cannot read properties of undefined (reading 'substr') #327

Merged
merged 3 commits into from
Jun 9, 2022

Conversation

iagojsilva
Copy link
Contributor

The actionable triggers returned from the backend can be either:

1. {
     pattern: `string`,
     hyperlink: `boolean`
    }

2. string

The code wasn't expecting the actionable trigger to be a string, so it was trying to do

const trigger = '/regex-as-string\g'.pattern // undefined
const toRegex = toRegex(trigger) // Cannot read properties of undefined (reading 'substr')

LucasPaganini and others added 2 commits May 26, 2022 11:14
Merge updates from gravwell/dev into unvoid-io/dev
Squashed commit of the following:

commit f47c35d
Author: iagojsilva <[email protected]>
Date:   Wed Jun 8 19:50:37 2022 -0300

    🚀 Fix for actionables trigger

commit 80be283
Author: GeraldHamiltonWicks <[email protected]>
Date:   Wed Jun 8 11:23:49 2022 -0300

    refactor

commit fd5d15b
Author: GeraldHamiltonWicks <[email protected]>
Date:   Wed Jun 8 11:23:24 2022 -0300

    refactor

commit f95eaec
Author: GeraldHamiltonWicks <[email protected]>
Date:   Wed Jun 8 10:58:16 2022 -0300

    adding is statement

commit 93152ae
Author: GeraldHamiltonWicks <[email protected]>
Date:   Tue Jun 7 16:52:54 2022 -0300

    fixinf if statement

commit c5b2df0
Author: GeraldHamiltonWicks <[email protected]>
Date:   Tue Jun 7 13:55:43 2022 -0300

    remove old substr in foavor of substring, and checking if raw is not empty
@iagojsilva iagojsilva added the bug label Jun 8, 2022
@iagojsilva iagojsilva self-assigned this Jun 8, 2022
@iagojsilva iagojsilva merged commit c330f48 into dev Jun 9, 2022
@michael-wisely-gravwell michael-wisely-gravwell deleted the fix/325-actionable branch July 22, 2022 20:38
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants